package com.wht.advice;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * @author wanghaotian
 * time:2022/11/30,0030 15:17
 * description:
 */

public class MyInterceptor implements MethodInterceptor {
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        try {
            System.out.println("前环绕");
            System.out.println("前环绕");
            methodInvocation.proceed();

            System.out.println("后环绕");

        } catch (Throwable throwable) {
            throwable.printStackTrace();
            System.out.println("xxx");
        } finally {
            System.out.println("最终");
        }
        return null;
    }
}
